/*  
 * Video Game Network Library
 * http://gamenetlib.codeplex.com/
 * 
 * Copyright (c) 2011 Joe Hegarty
 *  
 * This source code is subject to the terms of the Microsoft Public License (Ms-PL). 
 *  
 * Redistribution and use in source and binary forms, with or without modification, 
 * is permitted provided that redistributions of the source code retain the above 
 * copyright notices and this file header. 
 * 
 * For details, see <http://www.opensource.org/licenses/ms-pl.html>. 
 *  
 * All other rights reserved. 
 *
 */  

#ifndef __NET_LIB_SOCKET_WRAPPER__
#define __NET_LIB_SOCKET_WRAPPER__

#include "PublicIncludes.hpp"

namespace NNetLib
{
	class CSocketAddress;

	class CSocketWrapper
	{
	public:
		CSocketWrapper();
		~CSocketWrapper();

		bool Create(u16 portNumber);
		void Close();
		bool SetBlocking(bool blocking);

		bool Send(const CSocketAddress& destinationAddress, const char* p_data, u32 dataSize);
		bool Receive(CSocketAddress& outAddress, char* p_outData, u32& outSize, u32 dataBufferSize);

		

	private:
		SOCKET m_socketHandle;
		bool m_blocking;
	};

}

#endif // __NET_LIB_SOCKET_WRAPPER__